package com.middlegroup.pay.service;

import com.middlegroup.common.model.PayRequest;
import com.middlegroup.common.model.RefundRequestDto;
import com.middlegroup.common.model.TransResult;
import com.paypal.api.payments.Payment;
import com.paypal.api.payments.Refund;
import com.paypal.base.rest.PayPalRESTException;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author pc123
 * @since 2019-01-10
 */
public interface PaypalService {
     TransResult payPalPay(PayRequest request);
     String executePayment(String paymentId, String payerId);
     Payment payCreditCard() throws PayPalRESTException;
     TransResult saleRefund(RefundRequestDto refundRequestDto,TransResult transResult);
     Payment queryPay(String id) throws PayPalRESTException;
     Refund queryRefund(String id) throws PayPalRESTException;
     /**
      * paypal异步通知
      * @param request
      * @return
      */
     void payPalNotify(HttpServletRequest request);
}
